//对侧边栏栏目的设计
import 'package:flutter/material.dart';

class MyListTile extends StatelessWidget {
  final String text;
  final IconData icon;
  final void Function()? onTap;

  const MyListTile({
    super.key,
    required this.text,    //需要指定侧边栏文本
    required this.icon,    //需要指定图标
    required this.onTap,   //需要指定按下时的动作
  });

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(left:25.0),
      child: ListTile(
        leading:
          Icon(
            icon,
            color: Colors.grey,
          ),
          title:Text(text),
          onTap:onTap ,
      ),
    );
  }
}